package com.demo.controller;

import com.demo.common.aop.LoginAop;
import com.demo.common.base.ResultModel;
import com.demo.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description: MenuController
 * @Author: ChenXueLi
 * @Date: 2018-10-05 19:03
 */
@Api(value = "MenuController", description = "菜单接口")
@Controller
@CrossOrigin
public class MenuController {

    @Autowired
    private MenuService menuService;

    @LoginAop
    @ApiOperation(value = "获取菜单信息", notes = "获取菜单信息接口", httpMethod = "POST")
    @RequestMapping(value = "/getMenuList", method = RequestMethod.POST)
    @ResponseBody
    public ResultModel getMenuList(ResultModel resultModel, HttpServletRequest request, HttpServletResponse response) throws Exception{
        return menuService.getMenuList(resultModel, request, response);
    }

}
